#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>

#include "debug.h"
#include "typedef.h"

void BUG(const char* bug, int err)
{
    printf("BUG[%d]:%s\n", err, bug);
    exit(-1);
}    

			
void debug_shownear(uchar *buf, uint showbytes)
{

	char tmp[100];

	strncpy(tmp,(char*)(buf-2), showbytes);
	tmp[showbytes] = 0;

	if(strlen(tmp) != showbytes)
		printf("zero terminator found\n");

	//printf("%s\n",tmp);
}


